import re

str1 = "python itheima"
# match从头匹配
result = re.match("python", str1)
print(result)
print(result.span())
print(result.group())

# search 搜索匹配
str2 = "1python itheima"
result2 = re.search("python", str2)
print(result2)

# findall 搜索全部匹配
str3 = "1python itheima python 2python python"
result3 = re.findall("python", str3)
print(result3)